package com.hyperboost.controller;

import com.hyperboost.result.Result;
import com.hyperboost.service.NoticeService;
import com.hyperboost.vo.NoticeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/frontend/notice")
public class NoticeController {
    @Autowired
    private NoticeService noticeService;


    /**
     * 获取所有状态为1的公告信息
     *
     * @return
     */
    @GetMapping("/getAllNotice")
    public Result<List<NoticeVO>> getAllNotice() {
        List<NoticeVO> noticeList = noticeService.getAllNotice();
        return Result.success(noticeList);
    }
}
